<?php
$this->breadcrumbs=array(
	Yii::t('Ccu', 'Categories') => array('index'),
	$model->name,
);

$this->menu=array(
	array('label'=>Yii::t('Ccu','List Category'), 'url'=>array('index')),
	array('label'=>Yii::t('Ccu','Create Category'), 'url'=>array('create')),
	array('label'=>Yii::t('Ccu','Update Category'), 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>Yii::t('Ccu','Delete Category'), 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>Yii::t('Ccu','Manage Category'), 'url'=>array('admin')),
);
?>

<h1>View Category <?php echo ' - '. $model->name; ?></h1>

<?php
if ($model->modified_time == NULL){
    $this->widget('zii.widgets.CDetailView', array(
        'data'=>$model,
        'attributes'=>array(
            'id',
            array(
                'label' => 'Parent',
                'type'  => 'raw',    
                'value' => ($model->parent_id == 0) ? $model->getParentName() : CHtml::link($model->getParentName(), array('view', 'id'=>$model->parent_id))
            ),
            'name',
            array(
                'label' => 'Status',
                'value' => CHtml::encode($model->getStatusName())
            ),
            'description',
            array(               
                'label'=>'Create time',
                'value'=>CHtml::encode(date('d/m/y H:i:s',$model->created_time)),
            ),
            'created_by',
            'modified_time',
            'modified_by',
        ),
    ));
}else{
    $this->widget('zii.widgets.CDetailView', array(
        'data'=>$model,
        'attributes'=>array(
            'id',
            array(
                'label' => 'Parent',
                'type'  => 'raw',    
                'value' => ($model->parent_id == 0) ? $model->getParentName() : CHtml::link($model->getParentName(), array(view, id=>$model->parent_id))
            ),
            'name',
            array(
                'label' => 'Status',
                'value' => CHtml::encode($model->getStatusName())
            ),
            'description',
            array(               
                'label'=>'Create time',
                'value'=>CHtml::encode(date('d/m/y H:i:s',$model->created_time)),
            ),
            'created_by',
            array(               
                'label'=>'Modified time',
                'value'=>CHtml::encode(date('d/m/y H:i:s',$model->modified_time)),
            ),
            'modified_by',
        ),
    ));
}
?>
